<template>
    <br>
    <p1>name:{{ name }}</p1>
    <br>
    <button @click="showName">点击</button>
    <br>
    <p1>姓名：{{ student.name }}</p1><br>
    <p1>年龄：{{ student.age }}</p1><br>
    <p1>性别：{{ student.sex }}</p1><br>
</template>

<script lang="ts">
export default {
    name: 'Hello'
}
</script>

<!--setup语法糖-->
<script setup lang="ts">
import { ref, reactive } from 'vue'

let name = ref('张三')

let student = reactive({name:'zs',age:18,sex:'男'})

function showName() {
    name.value = 'zs'
    alert(name.value)
}
</script>